﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SortByDelegates;
using SortByAbstractClasses;

namespace Examples
{
    class Program
    {
        #region Constructors

        static Program()
        {
            arr = new int[10] { 2, 4, 5, 8, 1, 0, 9, 7, 3, 6 };
        }
        
        #endregion

        static void Main(string[] args)
        {
            Console.WriteLine("---------------------DELEGATES------------------");

            BubbleSort.Sort(ref arr, new BubbleSort.MySortCriteria(BubbleSort.Decrease));

            Console.WriteLine("-------=Decrease=------");
            foreach (int item in arr)
            {
                Console.WriteLine(item);
            }

            BubbleSort.Sort(ref arr, new BubbleSort.MySortCriteria(BubbleSort.Increase));

            Console.WriteLine("-------=Increase=------");
            foreach (int item in arr)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine("---------------------NVI------------------");

            SortTemplate mySort = new DecreaseSort();
            mySort.Sort(ref arr);

            Console.WriteLine("-------=Decrease=------");
            foreach (int item in arr)
            {
                Console.WriteLine(item);
            }

            mySort = new IncreaseSort();
            mySort.Sort(ref arr);

            Console.WriteLine("-------=Increase=------");
            foreach (int item in arr)
            {
                Console.WriteLine(item);
            }

            Console.ReadKey();
        }

        #region Fields

        private static int[] arr;

        #endregion
    }
}
